/*
 * @Descripttion: 
 * @version: 
 * @Author: Eugene
 * @Date: 2024-07-08 17:08:38
 * @LastEditors: Andy
 * @LastEditTime: 2024-07-14 20:38:45
 */
/*
 *                   ___====-_  _-====___
 *             _--^^^#####//      \\#####^^^--_
 *          _-^##########// (    ) \\##########^-_
 *         -############//  |\^^/|  \\############-
 *       _/############//   (@::@)   \############\_
 *      /#############((     \\//     ))#############\
 *     -###############\\    (oo)    //###############-
 *    -#################\\  / VV \  //#################-
 *   -###################\\/      \//###################-
 *  _#/|##########/\######(   /\   )######/\##########|\#_
 *  |/ |#/\#/\#/\/  \#/\##\  |  |  /##/\#/  \/\#/\#/\#| \|
 *  `  |/  V  V  `   V  \#\| |  | |/#/  V   '  V  V  \|  '
 *     `   `  `      `   / | |  | | \   '      '  '   '
 *                      (  | |  | |  )
 *                     __\ | |  | | /__
 *                    (vvv(VVV)(VVV)vvv)
 * 
 *      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * 
 *                神兽保佑            永无BUG
 */


#include "All_Init.h"

//遥控相关变量
uint8_t DBUS_RX_DATA[19] = { 0 };
DBUS_Typedef WHW_V_DBUS = { 0 };
CONTAL_Typedef RUI_V_CONTAL = { 0 };

//裁判系统相关变量
ALL_RX_Data_T ALL_RX;
User_Data_T User_data;

//测试
uint8_t RX[20];

//监测
RUI_ROOT_STATUS_Typedef RUI_ROOT_STATUS;

//电机
MOTOR_Typdef Motors;

DJI_MOTOR_Typedef DJI_MOTOR_Pitch;
DJI_MOTOR_Typedef DJI_MOTOR_Roll;

void Everying_Init(void)
{
    //DWT初始化
    DWT_Init(480);

    //FDCAN初始化
    FDCAN1_Config();
    FDCAN2_Config();
    FDCAN3_Config();

    //定时器初始化


    //串口初始化
    __HAL_UART_ENABLE_IT(&huart1, UART_IT_IDLE);//测试
    HAL_UART_Receive_DMA(&huart1,(uint8_t *)RX,20);

	__HAL_UART_ENABLE_IT(&huart2, UART_IT_IDLE);//遥控
    HAL_UART_Receive_DMA(&huart2,(uint8_t *)DBUS_RX_DATA,18);

    __HAL_UART_ENABLE_IT(&huart4, UART_IT_IDLE);//裁判系统
    HAL_UART_Receive_DMA(&huart4,(uint8_t *)ALL_RX.Data,255);
}

void Motor_Init(void)
{

}
